Re-enable H/2 on the default HTTP client for Go 1.15+ #1156
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Go 1.15 fixes a long-standing bug in the HTTP/2 client that led to HTTP/2 being disabled by default in stripe-go as part of #903.
This PR modifies the default HTTP/2 client for those users running Go 1.15 or above to remove the restriction against using HTTP/2. It accomplishes this via the use of a
+build
tag (aka conditional compliation) of the new source filestripego115.go
.The bug is scheduled to be backported to 1.13.16 and 1.14.8, but even once those backports are complete, we can only conditionally compile against a major release of Go, per https://golang.org/cmd/go/#hdr-Build_constraints: